812d75
@@ -532,10 +532,10 @@
public static boolean getBoolean(Object o, PrimitiveObjectInspector oi) {
       StringObjectInspector soi = (StringObjectInspector) oi;
       if (soi.preferWritable()) {
         Text t = soi.getPrimitiveWritableObject(o);
-        result = t.getLength() != 0;
+        result = parseBoolean(t);
       } else {
         String s = soi.getPrimitiveJavaObject(o);
-        result = s.length() != 0;
+        result = parseBoolean(s);
       }
       break;
     case TIMESTAMP:
@@ -554,6 +554,24 @@
public static boolean getBoolean(Object o, PrimitiveObjectInspector oi) {
     return result;
   }
 
+
+  private static final String falseBooleans[] = { "false", "no", "off", "0", "" };
+
+  private static boolean parseBoolean(String s) {
+    for(int i=0;i<falseBooleans.length;i++){
+      if(falseBooleans[i].equalsIgnoreCase(s))
+        return false;
+    }
+    return true;
+  }
+
+  private static boolean parseBoolean(Text t) {
+    if(t.getLength()>5)
+      return true;
+    String strVal=t.toString();
+    return parseBoolean(strVal);
+  }
+
   /**
    * Get the byte value out of a primitive object. Note that
    * NullPointerException will be thrown if o is null. Note that
